<?php /* Smarty version 2.6.20, created on 2016-04-11 19:59:52
         compiled from ./stocks/index.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'shops', './stocks/index.php', 12, false),array('block', 'stocks', './stocks/index.php', 42, false),array('modifier', 'date_format', './stocks/index.php', 58, false),array('function', 'url', './stocks/index.php', 69, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/top.php", 'smarty_include_vars' => array('subject' => 'stocks')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "stocks/top.php", 'smarty_include_vars' => array('subject' => 'stocks')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div id="content">

    <div id="boxquery">
    <form method="get">
     <input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="stocks.php" />
        <input type="submit" value="查询" class="fr" onclick="orderBy('','',1)" />
         <input type="hidden" value="" id="orderby" name="orderby" />
         <input type="hidden" value="" id="ascdesc" name="ascdesc" />
        <li>仓库:&nbsp; <select id="shopid" name="shopid"><option value="">全部</option><?php $this->_tag_stack[] = array('shops', array()); $_block_repeat=true;smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><option value="<?php echo $this->_tpl_vars['shops']['id']; ?>
" <?php if ($this->_tpl_vars['shops']['id'] == $_GET['shopid']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['shops']['title']; ?>
</option><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></select></li>
        <li><div style="line-height: 15px;float:left;">产品ID:&nbsp; </div><textarea name="productid" style="resize:horizontal;float:left;height:30px;"><?php echo $_GET['productid']; ?>
</textarea></li>
        <li>产品关键字:&nbsp; <input id="keywords" name="keywords" type="text" size="30" value="<?php echo $_GET['keywords']; ?>
" /><!-- onclick="select()" 
        onkeyup="context_menu_products(this, 'keywords=[title]')" onfocus="context_menu_products(this, 'keywords=[title]')"  --></li>
        <li>库存:&nbsp; <input id="lnumber" name="lnumber" type="text" size="8" value="<?php echo $_GET['lnumber']; ?>
"/>-<input id="hnumber" name="hnumber" type="text" size="8" value="<?php echo $_GET['hnumber']; ?>
"/>
        </li>
        <li>&nbsp;&nbsp;&nbsp;产品条码:&nbsp; <input id="barcode" name="barcode" type="text" size="15"  value="<?php echo $_GET['barcode']; ?>
" />
        </li>
        <li>库存状态:&nbsp; <select id="shopwarningnum" name="shopwarningnum"><option value="0" <?php if ($_GET['shopwarningnum'] == 0): ?>selected<?php endif; ?>>全部</option><option value="1" <?php if ($_GET['shopwarningnum'] == 1): ?>selected<?php endif; ?>>库存充足</option><option value="2" <?php if ($_GET['shopwarningnum'] == 2): ?>selected<?php endif; ?>>库存预警</option></select></li>
    </form>
    </div>

    <table width="100%" border="0" cellspacing="0" cellpadding="5" id="lister">
      <tr id="title">
        <td width="40">编号</td>
        <td>仓库</td>
        <td>产品ID</td>
        <td>产品图</td>
        <td>产品名称</td>
        <td>规格</td>
        <td>单位</td>
        <td>库存总数 &nbsp;&nbsp;<a href="javascript:;" onclick="orderBy('stocks','asc')">↑</a>&nbsp;&nbsp;&nbsp; <a href="javascript:;" onclick="orderBy('stocks','desc')">↓</a></td>
       <td> 采购在途 </td>
        <td> 预发货</td>
        <td> 微仓</td>
        <td>实际库内库存</td>                
         <td>退货在途</td> 
        <td>虚拟库存</td>
        <td>&nbsp;</td>
      </tr>
      <?php $this->_tag_stack[] = array('stocks', array('limit' => 20,'pager' => 'pager','page' => $this->_tpl_vars['segment']['page'],'path' => $this->_tpl_vars['segment']['1'],'order' => $_GET['orderby'],'ascdesc' => $_GET['ascdesc'],'shopid' => $_GET['shopid'],'productid' => $_GET['productid'],'keywords' => $_GET['keywords'],'counter' => 1,'lnumber' => $_GET['lnumber'],'hnumber' => $_GET['hnumber'],'barcode' => $_GET['barcode'])); $_block_repeat=true;smarty_block_stocks($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
      <tr id="content">
        <td><?php echo $this->_tpl_vars['stocks']['id']; ?>
</td>
        <td><?php echo $this->_tpl_vars['stocks']['shop']; ?>
</td>
        <td><?php echo $this->_tpl_vars['stocks']['pid']; ?>
 </td>
        <td><img src="<?php echo $this->_tpl_vars['stocks']['product_pic']; ?>
" width="50" height="50"/></td>
        <td><?php echo $this->_tpl_vars['stocks']['product']; ?>
 </td>
        <td><?php echo $this->_tpl_vars['stocks']['spec']; ?>
</td>
        <td><?php echo $this->_tpl_vars['stocks']['unit']; ?>
</td>
        <td><?php echo $this->_tpl_vars['stocks']['stocks']+0; ?>
 <?php echo $this->_tpl_vars['stocks']['unit']; ?>
&nbsp;</td>
        <td align="center"><?php echo $this->_tpl_vars['stocks']['purchases']+0; ?>
</td>
        <td align="center"><?php echo $this->_tpl_vars['stocks']['orders']+0; ?>
</td>
        <td align="center"><?php echo $this->_tpl_vars['stocks']['microstock_nums']+0; ?>
</td>
        <td align="center"><?php echo $this->_tpl_vars['stocks']['stocks']-$this->_tpl_vars['stocks']['orders']-$this->_tpl_vars['stocks']['microstock_nums']; ?>
<?php if ($this->_tpl_vars['stocks']['stocks']-$this->_tpl_vars['stocks']['orders']+0 <= $this->_tpl_vars['stocks']['shopwarningnum']): ?><span style="color:red;"><br/>(库存预警)</span><?php endif; ?></td>
        <td align="center"><?php echo $this->_tpl_vars['stocks']['reback']+0; ?>
</td>
        <td align="center"><?php echo $this->_tpl_vars['stocks']['canbuyout']; ?>
</td>
        <td><!-- 共(<?php echo $this->_tpl_vars['stocks']['more_stock']['nums']; ?>
)个批次<!-- ,最近保质期为:<span style="font-weight: bold;<?php if ($this->_tpl_vars['stocks']['more_stock']['data'][0]['timeend']-time() < 2592000): ?>color:red<?php endif; ?>"><?php echo ((is_array($_tmp=$this->_tpl_vars['stocks']['more_stock']['data'][0]['timeend'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span> --></td>
      </tr>
      <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_stocks($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
      <?php if ($this->_tpl_vars['pager']->rows == 0): ?>
      <tr id="content">
        <td colspan="20">&nbsp;</td>
      </tr>
      <?php endif; ?>
    </table>
    <div id="pager" class="mt10">
        <?php if ($this->_tpl_vars['pager']): ?><span class="fr"><strong>合计</strong>: 库存数量:<?php echo $this->_tpl_vars['stocks']['counter']['number']+0; ?>
</span> 共<?php echo $this->_tpl_vars['pager']->rows; ?>
条记录 第<?php echo $this->_tpl_vars['pager']->pagecurrent; ?>
/<?php echo $this->_tpl_vars['pager']->pages; ?>
页 <?php endif; ?> 		
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => 1), $this);?>
">首页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current-1), $this);?>
">上页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current+1), $this);?>
">下页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->pages), $this);?>
">尾页</a><?php endif; ?>
    </div>
    <br/>
    <form method="post" target="export_iframe" id="export_form" action=""><input type="hidden" value="export" name="act"/></form>
    <iframe src="" style="display:none;" id="export_iframe" name="export_iframe"></iframe>
    <div style="float:right" id="els_export">
            <a href="javascript:;" onclick="$('#export_form').submit();">导出EXCEL</a></div>
</div>
<script>
<?php echo '
function orderBy(o,s,no){
    $(\'#orderby\').val(o);
    $(\'#ascdesc\').val(s);
    if(!no){
        $(\'#boxquery\').find(\'form\').submit();
    }
    
}
'; ?>

</script>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/bottom.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>